package com.ibeeking.found.report.service.common.dos;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ibeeking.found.common.base.BaseDO;
import com.ibeeking.nematos.utils.bean.BeanUtil;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 基础数据库实体
 * @author lr
 * @since 2021-01-12
 */
public class ReportBaseDO implements Converter  {

    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    /**
     * 版本号
     * @Version:乐观锁,，需要添加mybatis plus插件optimisticLockerInterceptor
     */
    @TableField(value="version",fill = FieldFill.INSERT_UPDATE, update="%s+1")
    @Version
    private Integer version;
    /**
     * 运行参数，导入导出时，该条数据，对应在excel中的索引号
     */
    @TableField(value="row_index", exist = false)
    @JsonIgnore
    private Integer rowIndex;

    @TableField("create_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField("create_by")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long createBy;

    @TableField("modify_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifyTime;

    @TableField("modify_by")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long modifyBy;

    @TableField("del_status")
    private Integer delStatus = 0;

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Integer getRowIndex() {
        return rowIndex;
    }

    public void setRowIndex(Integer rowIndex) {
        this.rowIndex = rowIndex;
    }

    public Long getId() {
        return this.id;
    }

    public LocalDateTime getCreateTime() {
        return this.createTime;
    }

    public Long getCreateBy() {
        return this.createBy;
    }

    public LocalDateTime getModifyTime() {
        return this.modifyTime;
    }

    public Long getModifyBy() {
        return this.modifyBy;
    }

    public Integer getDelStatus() {
        return this.delStatus;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    public void setModifyBy(Long modifyBy) {
        this.modifyBy = modifyBy;
    }

    public void setDelStatus(Integer delStatus) {
        this.delStatus = delStatus;
    }

    @Override
    public String toString(){
        return JSON.toJSONString(this);
    }

}
